const a = async function (
  _,
  { origin },
  { dc: { http, store }, xe: { get }, dayjs, $grid }
) {
  const form = get(origin, "0cd412effcc14273872c0a9227f20d59", {});
  const YEAR = dayjs(store.get("user", "date")).format("YYYY");
  const params = { ...form };
  if (params.ENTERPRISEINCODE && Array.isArray(params.ENTERPRISEINCODE)) {
    params.ENTERPRISEINCODE = params.ENTERPRISEINCODE.join();
  }
  const { ENDDATE } = params;
  const year = Number(ENDDATE.split("-")[0]);
  const date = ENDDATE.split("-").join(".");
  const BDQK = $grid.getColumnByField("BDQK");
  if (BDQK) BDQK.title = `${year}年变动情况`;
  const MONEY1 = $grid.getColumnByField("MONEY1");
  if (MONEY1) MONEY1.title = `${year - 1}年年底担保`;
  const MONEY2 = $grid.getColumnByField("MONEY2");
  if (MONEY2) MONEY2.title = `${year}年新增/减少`;
  const MONEY3 = $grid.getColumnByField("MONEY3");
  if (MONEY3) MONEY3.title = `${date}担保`;
  const MONEY4 = $grid.getColumnByField("MONEY4");
  if (MONEY4) MONEY4.title = `${year}年年底担保`;
  for (let i = 1; i < 11; i++) {
    const field = `PLANMONEY${i}`;
    const col = $grid.getColumnByField(field);
    if (col) {
      col.title = `${year + i - 1}年${i === 10 ? "及以后" : ""}`;
    }
  }
  const data = await http.form({
    url: "/zw/czQuery/guarantee_plan",
    params: {
      ...params,
      id: 2625,
      CALCYEAR: year,
      ENDYEAR: year - 1,
      pageIndex: 0,
      pageSize: 10,
      YEAR,
    },
  });
  return { items: data, total: 0 };
};
